package br.com.foxinline.servico;

import br.com.foxinline.modelo.OrigemAlimentacao;
import java.util.List;
import javax.ejb.Stateless;

/**
 *
 * @author laverson
 */
@Stateless
public class OrigemAlimentacaoServico extends ServicoGenerico<OrigemAlimentacao> {

    public OrigemAlimentacaoServico() {
        super(OrigemAlimentacao.class);
    }

    public List<OrigemAlimentacao> autoComplete(String query) {
        List<OrigemAlimentacao> results = getEntityManager().createQuery("select o from " + OrigemAlimentacao.class.getSimpleName() + " o where lower(o.nome) like '%" + query.toLowerCase().trim() + "%'").getResultList();
        return results;
    }
}
